package com.ruoyi.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.ScollResponse;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.business.domain.ShopOrder;
import com.ruoyi.business.vo.ShopOrderVo;
import com.ruoyi.business.mapper.ShopOrderMapper;
import com.ruoyi.business.service.IShopOrderService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单Service业务层处理
 *
 * @author Tellsea
 * @date 2025-01-17
 */
@Service
public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder> implements IShopOrderService {

    @Override
    public TableDataInfo<ShopOrderVo> queryList(ShopOrderVo entity) {
        return PageUtils.buildDataInfo(this.baseMapper.queryList(PageUtils.buildPage(), entity));
    }

    @Override
    public List<ShopOrderVo> queryAll(ShopOrderVo entity) {
        return this.baseMapper.queryList(entity);
    }

    @Override
    public ShopOrderVo queryById(Long orderId) {
        return this.baseMapper.queryById(orderId);
    }

    public int removeOrder(String time) {
        return  this.baseMapper.remodeOrder(time);
    }

    public int getCountMonth(String time) {
        return this.baseMapper.getCountMonth(time);
    }

    public int updateStatusByOrderId(String orderId) {
        return this.baseMapper.updateStatusByOrderId(orderId);
    }

    public List<ScollResponse> getScoll() {
        return this.baseMapper.getScoll();
    }

    public int getSum(String time) {
        return this.baseMapper.getSum(time);
    }
}
